#include <iostream>
#include <string>
using namespace std;
int main()
{
    string s;
    cin >> s;
    int sum = 0, count = 1, n = s.size();
    for (int i = 0; i < n - 1; i++)
    {
        if (s[i] >= '0' && s[i] <= '9')
        {
            sum += (s[i] - '0') * count;
            count++;
        }
    }
    sum %= 11;
    if (sum == s[n - 1] - '0' || (sum == 10 && s[n - 1] == 'X'))
    {
        cout << "Right" << endl;
    }
    else
    {
        s[n - 1] = sum == 10 ? 'X' : sum + '0';
        cout << s << endl;
    }
    return 0;
}